package com.innovation.chengzhangriji.http;

import com.google.gson.annotations.SerializedName;
import com.innovation.library.http.InnovationRequestBody;

public class PasswordUpdateRequest extends BaseTokenRequest {

    public static final String PATH = BaseRequest.PATH + "api/change_password";

    private String passwordOld;

    private String passwordNew;

    public String getPasswordOld() {
        return passwordOld;
    }

    public void setPasswordOld(String passwordOld) {
        this.passwordOld = passwordOld;
    }

    public String getPasswordNew() {
        return passwordNew;
    }

    public void setPasswordNew(String passwordNew) {
        this.passwordNew = passwordNew;
    }

    @Override
    protected InnovationRequestBody getInnovationRequestBody() {
        PasswordUpdateRequestBody body = new PasswordUpdateRequestBody();
        body.setPhone(getPhone());
        body.setToken(getToken());
        body.setPasswordOld(passwordOld);
        body.setPasswordNew(passwordNew);
        return body;
    }

    private class PasswordUpdateRequestBody extends BaseTokenRequestBody {

        @SerializedName("OldPassword")
        private String passwordOld;

        @SerializedName("NewPassword")
        private String passwordNew;

        private PasswordUpdateRequestBody() {
            setSv(BaseRequestConfig.SV_PASSWORD_UPDATE);
        }

        public String getPasswordOld() {
            return passwordOld;
        }

        public void setPasswordOld(String passwordOld) {
            this.passwordOld = passwordOld;
        }

        public String getPasswordNew() {
            return passwordNew;
        }

        public void setPasswordNew(String passwordNew) {
            this.passwordNew = passwordNew;
        }
    }
}
